package be.sc.classicnetwork.service;

import java.util.Collection;
import java.util.Map;

import be.sc.classicnetwork.dao.CarDao;
import be.sc.classicnetwork.dao.PaginationSearchResult;
import be.sc.classicnetwork.model.Car;
import be.sc.classicnetwork.model.Contact;
import be.sc.classicnetwork.model.Image;
import be.sc.classicnetwork.model.Make;
import be.sc.classicnetwork.model.Option;

/**
 * Car Service.
 */
public interface CarService extends GenericService<Car> {

	/**
	 * saveOrUpdate.
	 */
	Car saveOrUpdate(Car car, Image[] images2delete, Collection<Option> options);

	/**
	 * countMakes.
	 */
	Collection<Object[]> countMakes(boolean enableFilterPublished);

	/**
	 * findAll.
	 */
	PaginationSearchResult findAll(int first, int max,
			boolean enableFilterPublished);

	/**
	 * @see CarDao#findByMake(int, int, boolean, Make)
	 */
	PaginationSearchResult findByMake(int first, int last,
			boolean enableFilterPublished, Make make);

	/**
	 * Finds the cars having a make or model like the specified value.
	 */
	PaginationSearchResult findByModelOrMakeLike(int offset, int maxPageItems,
			boolean enableFilterPublished, String model);

	/**
	 * findImageById.
	 */
	Image findImageById(String id);

	/**
	 * findContactsForNotification.
	 */
	Collection<Contact> findContactsForNotification(String carId);

	/**
	 * initCache.
	 */
	@SuppressWarnings("unchecked")
	Map getCache();

}
